import request from '@/utils/request'

// 查询工步列表
export function listSteps(query) {
  return request({
    url: '/base/steps/list',
    method: 'get',
    params: query
  })
}

// 查询工步详细
export function getSteps(id) {
  return request({
    url: '/base/steps/' + id,
    method: 'get'
  })
}

// 查询工步类型（扫码）
export function getStepsScan(operationCode) {
  return request({
    url: '/base/steps/selectByProductCodeAndStationCode/' + operationCode,

    method: 'get'
  })
}

// 查询工步类型（其他）
export function getStepsOther(operationCode) {
  return request({
    url: '/base/steps/selectByStationCode/' + operationCode,
    method: 'get'
  })
}

// 新增工步
export function addSteps(data) {
  return request({
    url: '/base/steps',
    method: 'post',
    data: data
  })
}

// 修改工步
export function updateSteps(data) {
  return request({
    url: '/base/steps',
    method: 'put',
    data: data
  })
}

// 删除工步
export function delSteps(id) {
  return request({
    url: '/base/steps/' + id,
    method: 'delete'
  })
}

// 导出工步
export function exportSteps(query) {
  return request({
    url: '/base/steps/export',
    method: 'get',
    params: query
  })
}